﻿using Lima.ResumeSys.Class;
using System;
using System.Collections.Generic;
using System.Data.OleDb;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lima.ResumeSys.DAL
{
    public class UserInfoDAL
    {
        private clsDbOperate dbOperate = new clsDbOperate();

        public DataRow GetUser(string UserName, string Pwd)
        {
            string sql = @"select * from UserInfo where UserName=@UserName and UserPaw=@UserPaw";

            OleDbParameter[] parameters =
                {
                new OleDbParameter("@UserName", UserName),
                new OleDbParameter("@UserPaw", Pwd)
            };
            DataTable dt = dbOperate.ExecuteQuery(sql, parameters);
            if (dt != null && dt.Rows.Count > 0)
            {
                return dt.Rows[0];
            }
            else
            {
                return null;
            }
        }
    }
}
